<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>模拟select</title>
    <script src="jquery-3.1.1.js"></script>
    <style>
        div.sec {
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }
        
        ul,
        li {
            margin: 0;
            padding: 0;
            list-style: none;
            text-align: center;
        }
        
        p {
            margin: 0;
            width: 100px;
            height: 30px;
            background-color: #96FE92;
            text-align: center;
            line-height: 30px;
        }
        
        li {
            width: 200px;
            height: 30px;
            line-height: 30px;
            border-bottom: 1px dotted red;
        }
        
        #li1 {
            width: 202px;
            background-color: #D3D3D3;
        }
        
        ul {
            border: 1px solid red;
            display: none;
        }
        .sec2{
            height: 155px;
            /*border: 1px solid red;*/
        }
    </style>
</head>

<body>
    <div class="sec">
        <p>选择项目:</p>
        <div class="sec2">
            <p id="li1">未选择</p>
            <ul>
                <li>html5</li>
                <li>css3</li>
                <li>javaScript</li>
                <li>jQuery</li>
            </ul>
        </div>
    </div>
</body>

</html>
<script>
    $('#li1').click(function(){
        $('ul').show();
    })
    $('li').hover(function(){
        $(this).css('background-color','#D3D3D3');
    },function(){
        $(this).css('background-color','#fff');
    })
    $('li').click(function(){
        $('#li1').text($(this).text());
        $('ul').hide();
    })
    $('.sec2').mouseleave(function(){
        $('ul').hide()
    })
</script>